#ifndef __DEFINES_H
#define __DEFINES_H

#include <QString>
#include <QVariant>

typedef struct s_OperatePoint
{
    QString RegisterAddr;
    // QString RegisterAlias;

    QString _OrderKey;
    QString _DeviceKey;
    QString _DeviceNameCN;

    QString RegisterType;
    QString RegisterCoefficient;
}OperatePoint;

Q_DECLARE_METATYPE(OperatePoint)

typedef struct s_RegisterInfo
{
    unsigned int slaveID;
    unsigned int funCode;
    unsigned int registerBegin;
    unsigned int registerEnd;
    unsigned int registerType;
}RegisterInfo;

Q_DECLARE_METATYPE(RegisterInfo)

enum RegisterType
{
    BITS_VALUE = 0, // 0 信号量
    SWITCH_VALUE,   // 1 开关量
    ANALOG_VALUE,   // 2 模拟量(无符号)
    FLOAT_VALUE,    // 3 单浮点数abcd
    SWAP_FLOAT,     // 4 单浮点数badc
    DOUBLE_VALUE,
    SWAP_DOUBLE,
    REVERSE_FLOAT,  // 7 单浮点数dcba
    ANALOG_SIGN     // 8 模拟量(有符号)
};

#endif // __DEFINES_H
